//
//  BaseTabbarController.swift
//  MySwift
//
//  Created by 李 on 2019/8/18.
//  Copyright © 2019 李. All rights reserved.
//

import UIKit

class BaseTabbarController: UITabBarController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        setUpTabbarController()
        
    }

}

extension BaseTabbarController {
    private func setUpTabbarController(){
        let firstVc = FirstVController();
        let secondVc = SecondVController();
        let oneNav = UINavigationController(rootViewController: firstVc)
        let twoNav = UINavigationController(rootViewController: secondVc)
        let oneTabbarItem = UITabBarItem(title: "首页", image: UIImage.init(named: "bar_js_ic-1") , selectedImage: UIImage.init(named: "bar_wd_pre_ic"))
        let towTabbarItem = UITabBarItem(title: "任务", image: UIImage.init(named: "bar_js_ic") , selectedImage: UIImage.init(named: "bar_js_pre_ic"))
        oneNav.tabBarItem = oneTabbarItem;
        twoNav.tabBarItem = towTabbarItem;
        self.tabBar.tintColor = UIColor.orange
        self.viewControllers = [oneNav,twoNav];
        self.tabBar.isTranslucent = false
        
       
    }
    
    
    
    
}



